using System;

namespace Flood.Log
{
	public class ShapeColorChanged : IChange
	{
		private readonly char oldColor;
		private readonly Shape shape;
		private readonly Action<char> undoColorChange;

		public ShapeColorChanged(Shape shape, Action<char> undoColorChange, char oldColor)
		{
			this.shape = shape;
			this.undoColorChange = undoColorChange;
			this.oldColor = oldColor;
		}

		#region IChange Members

		public Shape Shape
		{
			get { return shape; }
		}

		public void Undo()
		{
			undoColorChange(oldColor);
		}

		#endregion
	}
}